import { NavigationActions,StackActions} from 'react-navigation';

// import ScreenNames from 'imports/api/constants/screen-names';

let _navigator;

function setTopLevelNavigator(navigatorRef) {
  _navigator = navigatorRef;
}

function navigate(routeName, params) {
  _navigator.dispatch(
    NavigationActions.navigate({
      type: NavigationActions.NAVIGATE,
      routeName,
      params
    })
  );
}


function push(routeName, params) {
  _navigator.dispatch(
    StackActions.push({
      type: StackActions.PUSH,
      routeName,
      params
    })
  );
}

// add other navigation functions that you need and export them

// function navigateToHomeTab(params) {
//   navigate(ScreenNames.HomeTab, params);
// }
//
// function navigateToAuthStack(params) {
//   navigate(ScreenNames.AuthStack, params);
// }

function goBack() {
  _navigator.dispatch(NavigationActions.back());
}

// function navigateSetUserInfo(params) {
//   navigate(ScreenNames.SetUserInfo, params);
// }
//
// function navigateSetPassword(params) {
//   navigate(ScreenNames.SetPassword, params);
// }

export default {
  // navigateToHomeTab,
  // navigateToAuthStack,
  navigate,
  goBack,
  push,
  // navigateSetUserInfo,
  // navigateSetPassword,
  setTopLevelNavigator
};
